import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:get/get.dart';
import 'package:life_service/color/hex.dart';
import 'package:life_service/extensions/ex_widget.dart';
import 'package:life_service/route/index.dart';
import 'package:life_service/ui/draw_under_line.dart';
import 'package:life_service/utils/styles.dart';
import 'package:life_service/utils/tools.dart';

class HomeIndexController extends GetxController
    with GetTickerProviderStateMixin {
  late TabController tabController;

  RxBool showTop = false.obs;

  String mode = 'light';

  List<String> tags = ['推荐', '情侣', '亲子', '民宿', '五星'];

  RxList<Widget> dataList = RxList([]);

  final int pageSize = 16;

  final int total = 45;

  final double maxHeight = 370.0;

  bool isLoding = false;

  late ScrollController controller;

  @override
  void onInit() {
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
    controller = ScrollController()
      ..addListener(() {
        if (controller.offset >
                (maxHeight - (44 + Get.mediaQuery.padding.top) / 2) &&
            mode == 'light') {
          mode = 'dark';
          showTop.value = true;
          SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
        } else if (controller.offset <
                (maxHeight - (44 + Get.mediaQuery.padding.top) / 2) &&
            mode == 'dark' &&
            controller.offset > maxHeight / 3) {
          mode = 'light';
          showTop.value = false;
          SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
        }
      });
    tabController = TabController(length: tags.length, vsync: this);
    initData();
    super.onInit();
  }

  @override
  void onClose() {
    tabController.dispose();
    super.onClose();
  }

  void initData() {
    for (var i = 0; i < pageSize; i++) {
      if (i % 2 == 0) {
        dataList.add(
          Align(
            alignment: Alignment.topLeft,
            child: SizedBox(
              width: 160,
              child: Column(
                children: [
                  Stack(
                    children: [
                      ClipRRect(
                        borderRadius: BorderRadius.circular(5.r),
                        child: Image.network(
                          'https://img2.baidu.com/it/u=1407638119,2449258627&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=235',
                          width: 160,
                          height: 110,
                          fit: BoxFit.fill,
                        ),
                      ),
                      Positioned(
                        top: 8,
                        right: 20,
                        child: Container(
                          constraints: const BoxConstraints.expand(
                              width: 82, height: 20),
                          decoration: BoxDecoration(
                            color: HexColor.rgba(0, 0, 0, 0.498039215686275),
                            borderRadius: BorderRadius.circular(10),
                          ),
                          alignment: Alignment.center,
                          child: Text(
                            '南锣鼓巷附近',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize10,
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 10),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '锦江之星（背景王府井店）',
                      style: StylesUtils.customTextStyle(
                        fontWeight: FontWeight.w700,
                        color: HexColor.color3333,
                      ),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 5),
                    alignment: Alignment.centerLeft,
                    child: Wrap(
                      spacing: 10,
                      alignment: WrapAlignment.start,
                      crossAxisAlignment: WrapCrossAlignment.center,
                      children: [
                        Text(
                          '4.6分',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color28d0,
                            fontWeight: FontWeight.w700,
                          ),
                        ),
                        Text(
                          '5000+消费',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontSize: StylesUtils.fontSize12,
                          ),
                        ),
                      ],
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 5),
                    alignment: Alignment.centerLeft,
                    child: Wrap(
                      spacing: 10,
                      alignment: WrapAlignment.start,
                      crossAxisAlignment: WrapCrossAlignment.center,
                      children: [
                        Text(
                          '360',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.colorFf62,
                            fontWeight: FontWeight.w700,
                            fontSize: StylesUtils.fontSize16,
                          ),
                        ),
                        Text(
                          '起',
                          style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999),
                        ),
                        Container(
                          constraints: const BoxConstraints.expand(
                              width: 55, height: 20),
                          alignment: Alignment.center,
                          decoration: BoxDecoration(
                            border: Border.all(
                              color: HexColor(HexColor.colorFfc7),
                            ),
                          ),
                          child: Text(
                            '新人红包',
                            style: StylesUtils.customTextStyle(
                              color: HexColor.colorFfc7,
                              fontSize: StylesUtils.fontSize10,
                            ),
                          ),
                        )
                      ],
                    ),
                  )
                ],
              ),
            ),
          ),
        );
      } else {
        dataList.add(
          Align(
            alignment: Alignment.topRight,
            child: SizedBox(
              width: 160,
              child: Column(
                children: [
                  Stack(
                    children: [
                      ClipRRect(
                        borderRadius: BorderRadius.circular(5.r),
                        child: Image.network(
                          'https://img2.baidu.com/it/u=1407638119,2449258627&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=235',
                          width: 160,
                          height: 110,
                          fit: BoxFit.fill,
                        ),
                      ),
                      Positioned(
                        top: 8,
                        right: 20,
                        child: Container(
                          constraints: const BoxConstraints.expand(
                              width: 82, height: 20),
                          decoration: BoxDecoration(
                            color: HexColor.rgba(0, 0, 0, 0.498039215686275),
                            borderRadius: BorderRadius.circular(10),
                          ),
                          alignment: Alignment.center,
                          child: Text(
                            '南锣鼓巷附近',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize10,
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 10),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '锦江之星（背景王府井店）',
                      style: StylesUtils.customTextStyle(
                        fontWeight: FontWeight.w700,
                        color: HexColor.color3333,
                      ),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 5),
                    alignment: Alignment.centerLeft,
                    child: Wrap(
                      spacing: 10,
                      alignment: WrapAlignment.start,
                      crossAxisAlignment: WrapCrossAlignment.center,
                      children: [
                        Text(
                          '4.6分',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color28d0,
                            fontWeight: FontWeight.w700,
                          ),
                        ),
                        Text(
                          '5000+消费',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontSize: StylesUtils.fontSize12,
                          ),
                        ),
                      ],
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 5),
                    alignment: Alignment.centerLeft,
                    child: Wrap(
                      spacing: 10,
                      alignment: WrapAlignment.start,
                      crossAxisAlignment: WrapCrossAlignment.center,
                      children: [
                        Text(
                          '360',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.colorFf62,
                            fontWeight: FontWeight.w700,
                            fontSize: StylesUtils.fontSize16,
                          ),
                        ),
                        Text(
                          '起',
                          style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999),
                        ),
                        Container(
                          constraints: const BoxConstraints.expand(
                              width: 55, height: 20),
                          alignment: Alignment.center,
                          decoration: BoxDecoration(
                            border: Border.all(
                              color: HexColor(HexColor.colorFfc7),
                            ),
                          ),
                          child: Text(
                            '新人红包',
                            style: StylesUtils.customTextStyle(
                              color: HexColor.colorFfc7,
                              fontSize: StylesUtils.fontSize10,
                            ),
                          ),
                        )
                      ],
                    ),
                  )
                ],
              ),
            ),
          ),
        );
      }
    }
  }

  Future<void> loadMore() async {
    Get.engine.addPostFrameCallback((callback) async {
      isLoding = true;
      await Future.delayed(const Duration(seconds: 4));
      if (dataList.length < total) {
        initData();
        isLoding = false;
      }
    });
  }
}

class HomeIndexView extends GetView<HomeIndexController> {
  const HomeIndexView({super.key});

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: controller.tags.length,
      child: NotificationListener(
        onNotification: (ScrollNotification scrollNotification) {
          if (scrollNotification is ScrollStartNotification) {
            debugPrint('Scrolling has started');
          } else if (scrollNotification is ScrollUpdateNotification) {
            debugPrint('Scrolling has update');
          } else if (scrollNotification is ScrollEndNotification) {
            debugPrint('Scrolling has ended');
          } else if (scrollNotification is OverscrollNotification) {
            if (scrollNotification.metrics.pixels >=
                    scrollNotification.metrics.maxScrollExtent &&
                !controller.isLoding &&
                controller.dataList.length < controller.total) {
              controller.loadMore();
            }
          }
          // Return true to cancel the notification bubbling.
          return true;
        },
        child: NestedScrollView(
          controller: controller.controller,
          headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
            return [
              SliverToBoxAdapter(
                child: SizedBox(
                  height: controller.maxHeight,
                  child: Stack(
                    children: [
                      Container(
                        padding: EdgeInsets.only(left: (Get.width - 344) / 2),
                        height: 298,
                        decoration: const BoxDecoration(
                          image: DecorationImage(
                            image: AssetImage('assets/images/u38.png'),
                            fit: BoxFit.fill,
                          ),
                        ),
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Container(
                              padding: Get.mediaQuery.padding,
                              alignment: Alignment.centerLeft,
                              child: Text(
                                '新人好礼包',
                                style: TextStyle(
                                  fontSize: 16.sp,
                                  color: HexColor(HexColor.color3333),
                                  fontWeight: FontWeight.w700,
                                ),
                              ),
                            ),
                            Container(
                              alignment: Alignment.centerLeft,
                              child: Text(
                                '100元红包',
                                style: TextStyle(
                                  color: HexColor(HexColor.colorFfc7),
                                  fontWeight: FontWeight.w700,
                                  fontSize: 28.sp,
                                ),
                              ),
                            ),
                            Align(
                              alignment: Alignment.centerLeft,
                              child: TextButton(
                                onPressed: () {},
                                style: ButtonStyle(
                                  backgroundColor: WidgetStatePropertyAll(
                                    HexColor(HexColor.colorFf62),
                                  ),
                                  fixedSize: const WidgetStatePropertyAll(
                                    Size(80, 30),
                                  ),
                                  minimumSize: const WidgetStatePropertyAll(
                                    Size(80, 30),
                                  ),
                                  alignment: Alignment.center,
                                  shape: WidgetStatePropertyAll(
                                    RoundedRectangleBorder(
                                      borderRadius: BorderRadius.circular(15),
                                    ),
                                  ),
                                  padding: const WidgetStatePropertyAll(
                                      EdgeInsets.zero),
                                ),
                                child: Text(
                                  '立即领取',
                                  style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 12.sp,
                                    fontWeight: FontWeight.normal,
                                  ),
                                ),
                              ),
                            )
                          ],
                        ),
                      ),
                      Positioned(
                        bottom: 10,
                        right: 0,
                        left: 0,
                        child: Center(
                          child: Container(
                            constraints: const BoxConstraints.expand(
                                width: 344, height: 220),
                            decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(4.r),
                              color: Colors.white,
                              boxShadow: const [
                                BoxShadow(
                                  offset: Offset.zero,
                                  color: Color.fromRGBO(
                                      204, 204, 204, 0.349019607843137),
                                  blurRadius: 5,
                                  spreadRadius: 0,
                                  blurStyle: BlurStyle.outer,
                                )
                              ],
                            ),
                            child: Column(
                              children: [
                                DrawUnderLine(
                                  dx: 15,
                                  strokeWidth: 2,
                                  child: Container(
                                    height: 45,
                                    padding: const EdgeInsets.symmetric(
                                        horizontal: 15),
                                    child: Row(
                                      mainAxisAlignment:
                                          MainAxisAlignment.spaceBetween,
                                      children: [
                                        Text(
                                          '北海',
                                          style: StylesUtils.customTextStyle(
                                            color: HexColor.color3333,
                                          ),
                                        ),
                                        Icon(
                                          CupertinoIcons.placemark_fill,
                                          size: 19,
                                          color: HexColor(HexColor.color3333),
                                        )
                                      ],
                                    ),
                                  ).onTap(() {
                                    Get.toNamed(Routes.selectCity);
                                  }),
                                ),
                                DrawUnderLine(
                                  dx: 15,
                                  strokeWidth: 2,
                                  child: Padding(
                                    padding: const EdgeInsets.symmetric(
                                        vertical: 15, horizontal: 15),
                                    child: Row(
                                      crossAxisAlignment:
                                          CrossAxisAlignment.center,
                                      children: [
                                        SizedBox(
                                          width: 82,
                                          child: Column(
                                            children: [
                                              Align(
                                                alignment: Alignment.centerLeft,
                                                child: Text(
                                                  '入住',
                                                  style: StylesUtils
                                                      .customTextStyle(
                                                    color: HexColor.colorCccc,
                                                  ),
                                                ),
                                              ),
                                              Container(
                                                alignment: Alignment.centerLeft,
                                                margin: const EdgeInsets.only(
                                                    top: 5),
                                                child: Text(
                                                  '10月17',
                                                  style: StylesUtils
                                                      .customTextStyle(
                                                    fontSize:
                                                        StylesUtils.fontSize16,
                                                    fontWeight: FontWeight.w700,
                                                    color: HexColor.color3333,
                                                  ),
                                                ),
                                              )
                                            ],
                                          ),
                                        ),
                                        Container(
                                          width: 82,
                                          margin:
                                              const EdgeInsets.only(left: 20),
                                          child: Column(
                                            children: [
                                              Align(
                                                alignment: Alignment.centerLeft,
                                                child: Text(
                                                  '离店',
                                                  style: StylesUtils
                                                      .customTextStyle(
                                                    color: HexColor.colorCccc,
                                                  ),
                                                ),
                                              ),
                                              Container(
                                                alignment: Alignment.centerLeft,
                                                margin: const EdgeInsets.only(
                                                    top: 5),
                                                child: Text(
                                                  '10月18',
                                                  style: StylesUtils
                                                      .customTextStyle(
                                                    fontSize:
                                                        StylesUtils.fontSize16,
                                                    fontWeight: FontWeight.w700,
                                                    color: HexColor.color3333,
                                                  ),
                                                ),
                                              )
                                            ],
                                          ),
                                        ),
                                        Expanded(
                                          child: Center(
                                            child: Text(
                                              '共1晚',
                                              style:
                                                  StylesUtils.customTextStyle(
                                                color: HexColor.color3333,
                                                fontSize:
                                                    StylesUtils.fontSize12,
                                              ),
                                            ),
                                          ),
                                        ),
                                        Center(
                                          child: Icon(
                                            CupertinoIcons.calendar,
                                            size: 19,
                                            color: HexColor(HexColor.color3333),
                                          ),
                                        )
                                      ],
                                    ).onTap(() {
                                      Get.toNamed(Routes.selectDate);
                                    }),
                                  ),
                                ),
                                DrawUnderLine(
                                  dx: 15,
                                  strokeWidth: 2,
                                  child: Container(
                                    height: 45,
                                    padding: const EdgeInsets.symmetric(
                                        horizontal: 15),
                                    child: Row(
                                      mainAxisAlignment:
                                          MainAxisAlignment.spaceBetween,
                                      children: [
                                        Text(
                                          '搜索酒店/地名/关键词',
                                          style: StylesUtils.customTextStyle(
                                            color: HexColor.colorCccc,
                                          ),
                                        ),
                                        Icon(
                                          CupertinoIcons.search,
                                          size: 19,
                                          color: HexColor(HexColor.color3333),
                                        )
                                      ],
                                    ),
                                  ).onTap(() {
                                    Get.toNamed(Routes.searchAddress);
                                  }),
                                ),
                                Expanded(
                                  child: Center(
                                    child: TextButton(
                                      style: ButtonStyle(
                                        fixedSize: const WidgetStatePropertyAll(
                                          Size(300, 44),
                                        ),
                                        minimumSize:
                                            const WidgetStatePropertyAll(
                                          Size(300, 44),
                                        ),
                                        backgroundColor: WidgetStatePropertyAll(
                                          HexColor(HexColor.colorFf62),
                                        ),
                                        alignment: Alignment.center,
                                      ),
                                      onPressed: () {
                                        Get.toNamed(Routes.hotelList);
                                      },
                                      child: Text(
                                        '搜 索',
                                        style: StylesUtils.customTextStyle(
                                          fontSize: StylesUtils.fontSize16,
                                        ),
                                      ),
                                    ),
                                  ),
                                )
                              ],
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
              ),
              Obx(
                () => SliverVisibility(
                  visible: controller.showTop.value,
                  sliver: PinnedHeaderSliver(
                    child: Container(
                      height: 44 + Get.mediaQuery.padding.top,
                      padding: EdgeInsets.only(
                          left: 30, top: Get.mediaQuery.padding.top),
                      alignment: Alignment.centerLeft,
                      decoration: BoxDecoration(
                        color: Colors.white,
                        border: Border(
                          bottom: BorderSide(
                            color: HexColor(HexColor.colorF2f2),
                          ),
                        ),
                      ),
                      child: Text(
                        '首页',
                        style: StylesUtils.customTextStyle(
                          fontWeight: FontWeight.w700,
                          fontSize: 18.sp,
                          color: HexColor.color3333,
                        ),
                      ),
                    ),
                  ),
                ),
              ),
              PinnedHeaderSliver(
                child: Container(
                  color: Colors.white,
                  alignment: Alignment.center,
                  child: Container(
                    constraints:
                        const BoxConstraints.expand(width: 333, height: 44),
                    child: ToolsUtils.getClientTabBar(
                        controller.tags, controller.tabController,
                        isScrollable: false),
                  ),
                ),
              ),
            ];
          },
          body: TabBarView(
            controller: controller.tabController,
            children: controller.tags
                .map(
                  (str) => CustomScrollView(
                    slivers: [
                      SliverPadding(
                        padding: const EdgeInsets.symmetric(horizontal: 15),
                        sliver: Obx(
                          () => SliverAlignedGrid.count(
                            itemBuilder: (_, int index) {
                              return controller.dataList[index].onTap(() {
                                Get.toNamed(Routes.hotelMain);
                              });
                            },
                            crossAxisCount: 2,
                            mainAxisSpacing: 15,
                            itemCount: controller.dataList.length,
                          ),
                        ),
                      ),
                      SliverToBoxAdapter(
                        child: Obx(
                          () => Container(
                            padding: const EdgeInsets.symmetric(vertical: 15),
                            alignment: Alignment.center,
                            child:
                                controller.dataList.length >= controller.total
                                    ? Text(
                                        '~~已经到底了~~',
                                        style: StylesUtils.customTextStyle(
                                          fontSize: StylesUtils.fontSize15,
                                          color: HexColor.color3333,
                                        ),
                                      )
                                    : const CircularProgressIndicator(),
                          ),
                        ),
                      ),
                    ],
                  ),
                )
                .toList(),
          ),
        ),
      ),
    );
  }

  List<Widget> get appendChild {
    List<Widget> lists = [];
    for (var i = 0; i < 16; i++) {
      if (i % 2 == 0) {
        lists.add(
          Align(
            alignment: Alignment.topLeft,
            child: SizedBox(
              width: 160,
              child: Column(
                children: [
                  Stack(
                    children: [
                      ClipRRect(
                        borderRadius: BorderRadius.circular(5.r),
                        child: Image.network(
                          'https://img2.baidu.com/it/u=1407638119,2449258627&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=235',
                          width: 160,
                          height: 110,
                          fit: BoxFit.fill,
                        ),
                      ),
                      Positioned(
                        top: 8,
                        right: 20,
                        child: Container(
                          constraints: const BoxConstraints.expand(
                              width: 82, height: 20),
                          decoration: BoxDecoration(
                            color: HexColor.rgba(0, 0, 0, 0.498039215686275),
                            borderRadius: BorderRadius.circular(10),
                          ),
                          alignment: Alignment.center,
                          child: Text(
                            '南锣鼓巷附近',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize10,
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 10),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '锦江之星（背景王府井店）',
                      style: StylesUtils.customTextStyle(
                        fontWeight: FontWeight.w700,
                        color: HexColor.color3333,
                      ),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 5),
                    alignment: Alignment.centerLeft,
                    child: Wrap(
                      spacing: 10,
                      alignment: WrapAlignment.start,
                      crossAxisAlignment: WrapCrossAlignment.center,
                      children: [
                        Text(
                          '4.6分',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color28d0,
                            fontWeight: FontWeight.w700,
                          ),
                        ),
                        Text(
                          '5000+消费',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontSize: StylesUtils.fontSize12,
                          ),
                        ),
                      ],
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 5),
                    alignment: Alignment.centerLeft,
                    child: Wrap(
                      spacing: 10,
                      alignment: WrapAlignment.start,
                      crossAxisAlignment: WrapCrossAlignment.center,
                      children: [
                        Text(
                          '360',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.colorFf62,
                            fontWeight: FontWeight.w700,
                            fontSize: StylesUtils.fontSize16,
                          ),
                        ),
                        Text(
                          '起',
                          style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999),
                        ),
                        Container(
                          constraints: const BoxConstraints.expand(
                              width: 55, height: 20),
                          alignment: Alignment.center,
                          decoration: BoxDecoration(
                            border: Border.all(
                              color: HexColor(HexColor.colorFfc7),
                            ),
                          ),
                          child: Text(
                            '新人红包',
                            style: StylesUtils.customTextStyle(
                              color: HexColor.colorFfc7,
                              fontSize: StylesUtils.fontSize10,
                            ),
                          ),
                        )
                      ],
                    ),
                  )
                ],
              ),
            ),
          ),
        );
      } else {
        lists.add(
          Align(
            alignment: Alignment.topRight,
            child: SizedBox(
              width: 160,
              child: Column(
                children: [
                  Stack(
                    children: [
                      ClipRRect(
                        borderRadius: BorderRadius.circular(5.r),
                        child: Image.network(
                          'https://img2.baidu.com/it/u=1407638119,2449258627&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=235',
                          width: 160,
                          height: 110,
                          fit: BoxFit.fill,
                        ),
                      ),
                      Positioned(
                        top: 8,
                        right: 20,
                        child: Container(
                          constraints: const BoxConstraints.expand(
                              width: 82, height: 20),
                          decoration: BoxDecoration(
                            color: HexColor.rgba(0, 0, 0, 0.498039215686275),
                            borderRadius: BorderRadius.circular(10),
                          ),
                          alignment: Alignment.center,
                          child: Text(
                            '南锣鼓巷附近',
                            style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize10,
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 10),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '锦江之星（背景王府井店）',
                      style: StylesUtils.customTextStyle(
                        fontWeight: FontWeight.w700,
                        color: HexColor.color3333,
                      ),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 5),
                    alignment: Alignment.centerLeft,
                    child: Wrap(
                      spacing: 10,
                      alignment: WrapAlignment.start,
                      crossAxisAlignment: WrapCrossAlignment.center,
                      children: [
                        Text(
                          '4.6分',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color28d0,
                            fontWeight: FontWeight.w700,
                          ),
                        ),
                        Text(
                          '5000+消费',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.color3333,
                            fontSize: StylesUtils.fontSize12,
                          ),
                        ),
                      ],
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: 5),
                    alignment: Alignment.centerLeft,
                    child: Wrap(
                      spacing: 10,
                      alignment: WrapAlignment.start,
                      crossAxisAlignment: WrapCrossAlignment.center,
                      children: [
                        Text(
                          '360',
                          style: StylesUtils.customTextStyle(
                            color: HexColor.colorFf62,
                            fontWeight: FontWeight.w700,
                            fontSize: StylesUtils.fontSize16,
                          ),
                        ),
                        Text(
                          '起',
                          style: StylesUtils.customTextStyle(
                              fontSize: StylesUtils.fontSize12,
                              color: HexColor.color9999),
                        ),
                        Container(
                          constraints: const BoxConstraints.expand(
                              width: 55, height: 20),
                          alignment: Alignment.center,
                          decoration: BoxDecoration(
                            border: Border.all(
                              color: HexColor(HexColor.colorFfc7),
                            ),
                          ),
                          child: Text(
                            '新人红包',
                            style: StylesUtils.customTextStyle(
                              color: HexColor.colorFfc7,
                              fontSize: StylesUtils.fontSize10,
                            ),
                          ),
                        )
                      ],
                    ),
                  )
                ],
              ),
            ),
          ),
        );
      }
    }
    return lists;
  }
}
